/*
 * Copyright 2008, James E. Kleckner

  This file is part of spread-excel.

  spread-excel is free software: you can redistribute it and/or modify
  it under the terms of the GNU Lesser General Public License as published by
  the Free Software Foundation, either version 3 of the License, or
  (at your option) any later version.

  spread-excel is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.

  You should have received a copy of the GNU General Public License
  along with Foobar.  If not, see <http://www.gnu.org/licenses/>.
*/

#include "windows.h"
#include "ExcelSpreadPub.h"
#include "assert.h"
#include <stdio.h>

int
main(int argc, char **argv)
{
    double d=5.0*5.0;
    assert(d == ExcelSpreadPub_square(5.0));
    printf("ExcelSpreadPub_square(5.0) 5*5=%g\n", d);
#if 1
    WCHAR *server = L"4803@localhost";
  //WCHAR *server = L"4803@mask2";
    WCHAR *user   = L"testmain";
    WCHAR *topic  = L"exceltest";
    WCHAR *foo    = L"foo";
    int ret;
    ret = ExcelSpreadPub_sp_connect_wc(&server, &user);
    printf("testmain: ExcelSpreadPub_sp_connect_wc(&L'%ls', &L'%ls')=%d\n", server, user, ret);
    WCHAR *lmess  = L"hello from testmain to exceltest";
    ret = ExcelSpreadPub_sp_pub_wc(&topic, &lmess);
    printf("testmain: ExcelSpreadPub_sp_pub_wc(&L'%ls', &L'%ls')=%d\n", topic, lmess, ret);
    lmess  = L"hello from testmain to foo";
    ret = ExcelSpreadPub_sp_pub_wc(&foo, &lmess);
    printf("testmain: ExcelSpreadPub_sp_pub_wc(&L'%ls', &L'%ls')=%d\n", foo,   lmess, ret);
#endif
    return 0;
}
